% CreatePresentationTableBound.m
%
% Created 5/5/2015 by Todd Messer
clear
clc
%% User Inputs
eta = exp(0.829270248/100);
theta = exp(0.445451273/100);
omega = eta/theta;
i_y = 0.259459451;
% alf = 0.33;
alf = 0.401838633;

% Locations
% location to save latex file.
LatexLoc = 'C:\Users\g1txm02\Desktop\MacroFun\DSGE Model\TRY-JRC-ADD-NOMINAL-SHARES\FOMC Model 3.0\Estimation';

%% Create Table
lowerboundR = log((alf*i_y^(-1)*(eta-1)+1)/(omega));

% Save output
Headers = {};
TableOut = [];
n = 0;
for i = 1
    TableOut(i,n+1) = eta; n = n+1; Headers = [Headers '\eta'];
    TableOut(i,n+1) = theta; n = n+1; Headers = [Headers '\theta'];
    TableOut(i,n+1) = omega; n = n+1; Headers = [Headers '\omega'];
    TableOut(i,n+1) = i_y; n = n+1; Headers = [Headers 'i_y'];
    TableOut(i,n+1) = alf; n = n+1; Headers = [Headers '\alpha'];
    TableOut(i,n+1) = lowerboundR; n = n+1; Headers = [Headers '\underline{R_*}'];
end

TableDisplay = [Headers; num2cell(TableOut)];
TableOutFull = TableOut;

%% Create Latex file
curcd = cd;
cd(LatexLoc)
fid = fopen('ParameterOutputLatex_Presentation.txt','w');

% Headers
fprintf(fid,'\\begin{tabular}{%s} \\toprule\r\n',repmat('l',size(Headers)));
fprintf(fid,'$%s$',Headers{1});
for i = 2:length(Headers)
    fprintf(fid,'& $%s$',Headers{i});
end
fprintf(fid,'\\\\ \\midrule \r\n');

% Values
for i = 1:size(TableOut,1)
    fprintf(fid,'%5.4f',TableOutFull(i,1));
    
    for j = 2:length(Headers)
        fprintf(fid,'& %5.4f',TableOutFull(i,j));
    end
    fprintf(fid,'\\\\ \r\n');
end
fprintf(fid,'\\bottomrule \\\\ \r\n \\end{tabular}');

fclose(fid);
cd(curcd);